<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        const data = [
            {
                label: '一级标题 1',
                children: [
                    {
                        label: '二级标题 1.1',
                        children: [
                            {
                                label: '三级标题 1.1.1',
                            },
                            {
                                label: '三级标题 1.1.2',
                            },
                            {
                                label: '三级标题 1.1.3',
                            },
                        ],
                    },
                    {
                        label: '二级标题 1.2',
                        children: [
                            {
                                label: '三级标题 1.2.1',
                            },
                            {
                                label: '三级标题 1.2.2',
                            },
                        ],
                    },
                    {
                        label: '二级标题 1.3',
                    },
                ],
            },
            {
                label: '一级标题 2',
                children: [
                    {
                        label: '二级标题 2.1',
                    },
                    {
                        label: '二级标题 2.2',
                    },
                    {
                        label: '二级标题 2.3',
                        children: [
                            {
                                label: '三级标题 2.3.1',
                            },
                            {
                                label: '三级标题 2.3.2',
                            },
                        ],
                    },
                ],
            },
            {
                label: '一级标题 3',
                children: [
                    {
                        label: '二级标题 3.1',
                    },
                    {
                        label: '二级标题 3.2',
                    },
                    {
                        label: '二级标题 3.3',
                    },
                    {
                        label: '二级标题 3.4',
                    },
                    {
                        label: '二级标题 3.5',
                    },
                ],
            },
        ];
        function createDl(node) {
            const dl = document.createElement('dl');
            const dt = document.createElement('dt');
            dt.innerText = node.label;
            dl.appendChild(dt);
            for (const child of node.children || []) {
                const dd = document.createElement('dd');
                const el = createDl(child);
                dd.appendChild(el);
                dl.appendChild(dd);
            }
            return dl;
        }
        for (const item of data) {
            const el = createDl(item);
            document.body.appendChild(el);
        }
         
    </script>
</body>

</html>